package com.yy.mydota;

import com.yy.database.DBHelperService;
import com.yy.utils.BitmapManager;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageView;

public class Loading extends Activity {
	private static String IMAGE_URL = "http://www.dota2.com.cn/resources/jpg/150429/10251430294517582.jpg";

	private DBHelperService ds;
	
	private ImageView imgv_start;
	private BitmapManager bm;
	//Alpha动画 - 渐变透明度  
    private Animation alphaAnimation = null;
    
    private SharedPreferences sharedPreferences;
    private boolean isFirstRun;
    
    private static String Earthshaker = "INSERT INTO HEROS VALUES ('10101001', '撼地者', 'Earthshaker', "+R.drawable.earthshaker_hphover+", '力量型', '先手-控制-辅助-对线辅助', '近战', '天辉', '小牛、神牛、撼地神牛', null);";
    private static String Sven = "INSERT INTO HEROS VALUES ('10101002', '斯温', 'Sven', "+R.drawable.sven_hphover+", '力量型', '控制-先手-核心-辅助', '近战', '天辉', 'SV、流浪', null);";
    private static String Tiny = "INSERT INTO HEROS VALUES ('10101003', '小小', 'Tiny', "+R.drawable.tiny_hphover+", '力量型', '控制 - 爆发 - 先手 - 耐久', '近战', '天辉', '山岭', '')";
    private static String Kunkka = "INSERT INTO HEROS VALUES ('10101004', '昆卡', 'coco', "+R.drawable.kunkka_hphover+", '力量型', '控制 - 先手 - 核心 - 耐久', '近战', '天辉', '船长', '')";
    private static String Beastmaster = "INSERT INTO HEROS VALUES ('10101005', '兽王', 'Beastmaster', "+R.drawable.beastmaster_hphover+", '力量型', '先手 - 控制 - 耐久', '近战', '天辉', 'BM', '')";
    private static String DragonKnight = "INSERT INTO HEROS VALUES ('10101006', '龙骑士', 'Dragon Knight', "+R.drawable.dragon_knight_hphover+", '力量型', '核心 - 耐久 - 控制 - 推进', '近战', '天辉', '龙骑，DK', '')";
    private static String Clockwerk = "INSERT INTO HEROS VALUES ('10101007', '发条技师', 'Clockwerk', "+R.drawable.rattletrap_hphover+", '力量型', '先手 - 耐久', '近战', '天辉', '发条、CG', '')";
    private static String Omniknight = "INSERT INTO HEROS VALUES ('10101008', '全能骑士', 'Omniknight', "+R.drawable.omniknight_hphover+", '力量型', '耐久 - 对线辅助 - 辅助', '近战', '天辉', '全能', '')";
    private static String Huskar = "INSERT INTO HEROS VALUES ('10102009', '哈斯卡', 'Huskar', "+R.drawable.huskar_hphover+", '力量型', '核心 - 先手 - 耐久', '远程', '天辉', '神灵、神灵武士', '')";
    private static String Alchemist = "INSERT INTO HEROS VALUES ('10101010', '炼金术士', 'Alchemist', "+R.drawable.alchemist_hphover+", '力量型', '耐久 - 核心 - 控制', '近战', '天辉', '炼金', '')";
    private static String Brewmaster = "INSERT INTO HEROS VALUES ('10101011', '酒仙', 'Brewmaster', "+R.drawable.brewmaster_hphover+", '力量型', '核心 - 耐久 - 先手 - 推进', '近战', '天辉', '熊猫', '')";
    private static String Treant = "INSERT INTO HEROS VALUES ('10101012', '树精卫士', 'Treant Protector', "+R.drawable.treant_hphover+", '力量型', '耐久 - 先手 - 对线辅助 - 控制', '近战', '天辉', '大树', '')";
    private static String IO = "INSERT INTO HEROS VALUES ('10102013', '艾欧', 'Io', "+R.drawable.wisp_hphover+", '力量型', '辅助 - 对线辅助 - 爆发', '远程', '天辉', '小精灵', '2015-05-29 23:40:23')";
    private static String Centaur = "INSERT INTO HEROS VALUES ('10101014', '半人马战行者', 'Centaur Warrunner', "+R.drawable.centaur_hphover+", '力量型', '耐久 - 控制 - 先手', '近战', '天辉', '人马', '')";
    private static String Timbersaw = "INSERT INTO HEROS VALUES ('10101015', '伐木机', 'Timbersaw', "+R.drawable.shredder_hphover+", '力量型', '近战 - 耐久 - 爆发 - 逃生', '近战', '天辉', '地精撕裂者', '')";
    private static String Bristleback = "INSERT INTO HEROS VALUES ('10101016', '钢背兽', 'Bristleback', "+R.drawable.bristleback_hphover+", '力量型', '耐久 - 先手 - 控制', '近战', '天辉', '钢背，背背猪', '')";
    private static String Tusk = "INSERT INTO HEROS VALUES ('10101017', '巨牙海民', 'Tusk', "+R.drawable.tusk_hphover+", '力量型', '先手 - 耐久', '近战', '天辉', '海民', '')";
    private static String ElderTitan = "INSERT INTO HEROS VALUES ('10101018', '上古巨神', 'Elder Titan', "+R.drawable.elder_titan_hphover+", '力量型', '先手 - 耐久', '近战', '天辉', '大牛', '')";
    private static String LegionCommander = "INSERT INTO HEROS VALUES ('10101019', '军团指挥官', 'Legion Commander', "+R.drawable.legion_commander_hphover+", '力量型', '核心 - 耐久', '近战', '天辉', '军团', '')";
    private static String EarthSpirit = "INSERT INTO HEROS VALUES ('10101020', '大地之灵', 'Earth Spirit', "+R.drawable.earth_spirit_hphover+", '力量型', '核心 - 爆发', '近战', '天辉', '土熊猫', '')";
    private static String Phoenix = "INSERT INTO HEROS VALUES ('10102021', '凤凰', 'Phoenix', "+R.drawable.phoenix_hphover+", '力量型', '先手-控制-爆发', '远程', '天辉', '凤凰', null);";
    private static String Axe = "INSERT INTO HEROS VALUES ('20101022', '斧王', 'Axe', "+R.drawable.axe_hphover+", '力量型', '耐久-先手-控制-打野', '近战', '夜魇', '蒙哥可汗、Mogul Khan、Axe', null);";
    private static String Pudge = "INSERT INTO HEROS VALUES ('20101023', '帕吉', 'Pudge', "+R.drawable.pudge_hphover+", '力量型', '耐久-控制', '近战', '夜魇', '屠夫、胖子', null);";
    private static String SandKing = "INSERT INTO HEROS VALUES ('20101024', '沙王', 'Sand King', "+R.drawable.sand_king_hphover+", '力量型', '先手 - 控制 - 爆发', '近战', '夜魇', 'SK', '')";
    private static String Slardar = "INSERT INTO HEROS VALUES ('20101025', '斯拉达', 'Slardar', "+R.drawable.slardar_hphover+", '力量型', '核心 - 耐久 - 控制 - 先手', '近战', '夜魇', '大鱼人', '')";
    private static String Tidehunter = "INSERT INTO HEROS VALUES ('20101026', '潮汐猎人', 'Tidehunter', "+R.drawable.tidehunter_hphover+", '力量型', '先手 - 耐久 - 控制 - 辅助', '近战', '夜魇', '潮汐、TH', '')";
    private static String WraithKing = "INSERT INTO HEROS VALUES ('20101027', '冥魂大帝', 'Wraith King', "+R.drawable.wraith_king_hphover+", '力量型', '耐久 - 核心 - 控制', '近战', '夜魇', 'SNK、骷髅王', '')";
    private static String Lifestealer = "INSERT INTO HEROS VALUES ('20101028', '噬魂鬼', 'Lifestealer', "+R.drawable.life_stealer_hphover+", '力量型', '核心 - 耐久 - 打野 - 逃生', '近战', '夜魇', '小狗', '')";
    private static String NightStalker = "INSERT INTO HEROS VALUES ('20101029', '暗夜魔王', 'Night Stalker', "+R.drawable.night_stalker_hphover+", '力量型', '耐久 - 先手', '近战', '夜魇', '夜魔', '')";
    private static String Doom = "INSERT INTO HEROS VALUES ('20101030', '末日使者', 'Doom', "+R.drawable.doom_bringer_hphover+", '力量型', '耐久 - 核心 - 爆发', '近战', '夜魇', '末日，爸爸', '')";
    private static String SpiritBreaker = "INSERT INTO HEROS VALUES ('20101031', '裂魂人', 'Spirit Breaker', "+R.drawable.spirit_breaker_hphover+", '力量型', '耐久 - 核心 - 先手 - 控制', '近战', '夜魇', '白牛，SB', '')";
    private static String Lycan = "INSERT INTO HEROS VALUES ('20101032', '狼人', 'Lycan', "+R.drawable.lycan_hphover+", '力量型', '核心 - 打野 - 推进 - 耐久', '近战', '夜魇', 'Lyc', '')";
    private static String ChaosKnight = "INSERT INTO HEROS VALUES ('20101033', '混沌骑士', 'Chaos Knight', "+R.drawable.chaos_knight_hphover+", '力量型', '核心 - 控制 - 耐久 - 推进', '近战', '夜魇', '混沌', '')";
    private static String Undying = "INSERT INTO HEROS VALUES ('20101034', '不朽尸王', 'Undying', "+R.drawable.undying_hphover+", '力量型', '耐久 - 推进 - 控制 - 先手', '近战', '夜魇', '尸王', '')";
    private static String Magnus = "INSERT INTO HEROS VALUES ('20101035', '马格纳斯', 'Magnus', "+R.drawable.magnataur_hphover+", '力量型', '先手 - 控制 - 爆发 - 核心', '近战', '夜魇', '猛犸', '')";
    private static String Abaddon = "INSERT INTO HEROS VALUES ('20101036', '亚巴顿', 'Abaddon', "+R.drawable.abaddon_hphover+", '力量型', '近战', '近战', '夜魇', '死骑', '')";
    private static String AntiMage = "INSERT INTO HEROS VALUES ('10201037', '敌法师', 'Anti Mage', "+R.drawable.antimage_hphover+", '敏捷型', '核心-逃生', '近战', '天辉', 'AM、敌法', null);";
    private static String DrowRanger = "INSERT INTO HEROS VALUES ('10202038', '卓尔游侠', 'Drow Ranger', "+R.drawable.drow_ranger_hphover+", '敏捷型', '核心', '远程', '天辉', '小黑、崔希丝', null);";
    private static String Juggernaut = "INSERT INTO HEROS VALUES ('10201039', '主宰', 'Juggernaut', "+R.drawable.juggernaut_hphover+", '敏捷型', '核心 - 推进', '近战', '天辉', '剑圣', '')";
    private static String Mirana = "INSERT INTO HEROS VALUES ('10202040', '米拉娜', 'Mirana', "+R.drawable.mirana_hphover+", '敏捷型', '核心 - 爆发 - 控制 - 逃生', '远程', '天辉', '白虎，虎妞，月女', '')";
    private static String Morphling = "INSERT INTO HEROS VALUES ('10202041', '变体精灵', 'Morphling', "+R.drawable.morphling_hphover+", '敏捷型', '核心 - 逃生 - 先手 - 爆发', '远程', '天辉', '水人', '')";
    private static String PhantomLancer = "INSERT INTO HEROS VALUES ('10201042', '幻影长矛手', 'Phantom Lancer', "+R.drawable.phantom_lancer_hphover+", '敏捷型', '核心 - 逃生 - 推进', '近战', '天辉', '猴子、阿兹瑞斯', '')";
    private static String VengefulSpirit = "INSERT INTO HEROS VALUES ('10202043', '复仇之魂', 'Vengeful Spirit', "+R.drawable.vengefulspirit_hphover+", '敏捷型', '辅助 - 控制 - 对线辅助 - 先手', '远程', '天辉', 'VS、仙德尔莎?丝木', '')";
    private static String Riki = "INSERT INTO HEROS VALUES ('10201044', '力丸', 'Riki', "+R.drawable.riki_hphover+", '敏捷型', '核心 - 逃生', '近战', '天辉', '隐刺', '2015-05-30 19:08:51')";
    private static String Sniper = "INSERT INTO HEROS VALUES ('10202045', '狙击手', 'Sniper', "+R.drawable.sniper_hphover+", '敏捷型', '核心', '远程', '天辉', '火枪，传说哥', '2015-05-30 19:08:51')";
    private static String TemplarAssassin = "INSERT INTO HEROS VALUES ('10202046', '圣堂刺客', 'Templar Assassin', "+R.drawable.templar_assassin_hphover+", '敏捷型', '核心 - 逃生', '远程', '天辉', 'TA，圣堂', '2015-05-30 19:08:51')";
    private static String Luna = "INSERT INTO HEROS VALUES ('10202047', '露娜', 'Luna', "+R.drawable.luna_hphover+", '敏捷型', '核心 - 爆发', '远程', '天辉', '月骑', '2015-05-30 19:08:51')";
    private static String BountyHunter = "INSERT INTO HEROS VALUES ('10201048', '赏金猎人', 'Bounty Hunter', "+R.drawable.bounty_hunter_hphover+", '敏捷型', '核心 - 逃生 - 爆发', '近战', '天辉', '赏金,BH', '2015-05-30 19:08:51')";
    private static String Ursa = "INSERT INTO HEROS VALUES ('10201049', '熊战士', 'Ursa', "+R.drawable.ursa_hphover+", '敏捷型', '核心 - 打野 - 耐久', '近战', '天辉', '拍拍熊', '2015-05-30 19:08:51')";
    private static String Gyrocopter = "INSERT INTO HEROS VALUES ('10202050', '矮人直升机', 'Gyrocopter', "+R.drawable.gyrocopter_hphover+", '敏捷型', '控制 - 先手 - 爆发', '远程', '天辉', '飞机', '2015-05-30 19:08:51')";
    private static String LoneDruid = "INSERT INTO HEROS VALUES ('10202051', '德鲁伊', 'Lone Druid', "+R.drawable.lone_druid_hphover+", '敏捷型', '核心 - 耐久 - 推进 - 打野', '远程', '天辉', 'LD、熊德、DLY、小德', '2015-05-30 19:08:51')";
    private static String NagaSiren = "INSERT INTO HEROS VALUES ('10201052', '娜迦海妖', 'Naga Siren', "+R.drawable.naga_siren_hphover+", '敏捷型', '核心 - 控制 - 推进 - 逃生', '近战', '天辉', '小娜迦', '2015-05-30 19:08:51')";
    private static String TrollWarlord = "INSERT INTO HEROS VALUES ('10202053', '巨魔战将', 'Troll Warlord', "+R.drawable.troll_warlord_hphover+", '敏捷型', '核心', '远程', '天辉', '巨魔', '2015-05-30 19:08:51')";
    private static String EmberSpirit = "INSERT INTO HEROS VALUES ('10201054', '灰烬之灵', 'Ember Spirit', "+R.drawable.ember_spirit_hphover+", '敏捷型', '核心 - 爆发', '近战', '天辉', '火熊猫', '2015-05-30 19:08:51')";
    private static String Bloodseeker = "INSERT INTO HEROS VALUES ('20201055', '嗜血狂魔', 'Bloodseeker', "+R.drawable.bloodseeker_hphover+", '敏捷型', '核心-打野', '近战', '夜魇', 'BS、血魔', null);";
    private static String ShadowFiend = "INSERT INTO HEROS VALUES ('20202056', '影魔', 'ShadowFiend', "+R.drawable.nevermore_hphover+", '敏捷型', '远程-核心-爆发', '远程', '夜魇', 'SF', null);";
    private static String Razor = "INSERT INTO HEROS VALUES ('20202057', '剃刀', 'Razor', "+R.drawable.razor_hphover+", '敏捷型', '核心 - 耐久 - 爆发', '远程', '夜魇', '电棍', '2015-05-30 19:08:51')";
    private static String Venomancer = "INSERT INTO HEROS VALUES ('20202058', '剧毒术士', 'Venomancer', "+R.drawable.venomancer_hphover+", '敏捷型', '辅助 - 爆发 - 先手 - 推进', '远程', '夜魇', '剧毒', '2015-05-30 19:08:51')";
    private static String FacelessVoid = "INSERT INTO HEROS VALUES ('20201059', '虚空假面', 'FacelessVoid', "+R.drawable.faceless_void_hphover+", '敏捷型', '核心 - 先手 - 控制 - 逃生', '近战', '夜魇', '虚空', '2015-05-30 19:08:51')";
    private static String PhantomAssassin = "INSERT INTO HEROS VALUES ('20201060', '幻影刺客', 'Phantom Assassin', "+R.drawable.phantom_assassin_hphover+", '敏捷型', '核心 - 逃生', '近战', '夜魇', 'PA、幻刺、魅影之纱', '2015-05-30 19:08:51')";
    private static String Viper = "INSERT INTO HEROS VALUES ('20202061', '冥界亚龙', 'Viper', "+R.drawable.viper_hphover+", '敏捷型', '核心 - 耐久', '远程', '夜魇', 'VIP，毒龙', '2015-05-30 19:08:51')";
    private static String clinkz = "INSERT INTO HEROS VALUES ('20202062', '克林克兹', 'clinkz', "+R.drawable.clinkz_hphover+", '敏捷型', '辅助 - 爆发 - 先手 - 推进', '远程', '夜魇', '骨弓', '2015-05-30 19:08:51')";
    private static String Broodmother = "INSERT INTO HEROS VALUES ('20201063', '育母蜘蛛', 'Broodmother', "+R.drawable.broodmother_hphover+", '敏捷型', '辅助 - 爆发 - 先手 - 推进', '近战', '夜魇', '蜘蛛', '2015-05-30 19:08:51')";
    private static String Weaver = "INSERT INTO HEROS VALUES ('20202064', '编织者', 'Weaver', "+R.drawable.weaver_hphover+", '敏捷型', '核心 - 逃生', '远程', '夜魇', '蚂蚁', '2015-05-30 19:08:51')";
    private static String Spectre = "INSERT INTO HEROS VALUES ('20201065', '幽鬼', 'Spectre', "+R.drawable.spectre_hphover+", '敏捷型', '核心 - 耐久', '近战', '夜魇', 'Spe', '2015-05-30 19:08:51')";
    private static String Meepo = "INSERT INTO HEROS VALUES ('20201066', '米波', 'Meepo', "+R.drawable.meepo_hphover+", '敏捷型', '核心 - 控制 - 先手', '近战', '夜魇', '地卜', '2015-05-30 19:08:51')";
    private static String NyxAssassin = "INSERT INTO HEROS VALUES ('20201067', '司夜刺客', 'Nyx Assassin', "+R.drawable.nyx_assassin_hphover+", '敏捷型', '控制 - 爆发', '近战', '夜魇', 'NA，小强', '2015-05-30 19:08:51')";
    private static String Slark = "INSERT INTO HEROS VALUES ('20201068', '斯拉克', 'Slark', "+R.drawable.slark_hphover+", '敏捷型', '逃生', '近战', '夜魇', '小鱼人', '2015-05-30 19:08:51')";
    private static String Medusa = "INSERT INTO HEROS VALUES ('20202069', '美杜莎', 'Medusa', "+R.drawable.medusa_hphover+", '敏捷型', '核心', '远程', '夜魇', '一姐', '2015-05-30 19:08:51')";
    private static String Terrorblade = "INSERT INTO HEROS VALUES ('20201070', '恐怖利刃', 'Terrorblade', "+R.drawable.terrorblade_hphover+", '敏捷型', '核心', '近战', '夜魇', 'TB、魂守', '2015-05-30 19:08:51')";
    private static String CrystalMaiden = "INSERT INTO HEROS VALUES ('10302071', '水晶室女', 'Crystal Maiden', "+R.drawable.crystal_maiden_hphover+", '智力型', '远程-辅助-控制-爆发-对线辅助', '远程', '天辉', '冰女', null);";
    private static String Puck = "INSERT INTO HEROS VALUES ('10302072', '帕克', 'Puck', "+R.drawable.puck_hphover+", '智力型', '远程-先手-爆发-控制-逃生', '远程', '天辉', 'puck、精灵龙', null);";
    private static String StormSpirit = "INSERT INTO HEROS VALUES ('10302073', '风暴之灵', 'Storm Spirit', "+R.drawable.storm_spirit_hphover+", '智力型', '核心 - 先手 - 逃生 - 控制', '远程', '天辉', '蓝猫', '2015-05-30 19:08:51')";
    private static String Windranger = "INSERT INTO HEROS VALUES ('10302074', '风行者', 'Windranger', "+R.drawable.windrunner_hphover+", '智力型', '控制 - 爆发 - 辅助 - 逃生', '远程', '天辉', '风行，WR', '2015-05-30 19:08:51')";
    private static String Zeus = "INSERT INTO HEROS VALUES ('10302075', '宙斯', 'Zeus', "+R.drawable.zuus_hphover+", '智力型', '爆发 - 辅助', '远程', '天辉', '神王', '2015-05-30 19:08:51')";
    private static String Lina = "INSERT INTO HEROS VALUES ('10302076', '莉娜', 'Lina', "+R.drawable.lina_hphover+", '智力型', '爆发 - 控制 - 辅助', '远程', '天辉', '火女', '2015-05-30 19:08:51')";
    private static String ShadowShaman = "INSERT INTO HEROS VALUES ('10302077', '暗影萨满', 'Shadow Shaman', "+R.drawable.shadow_shaman_hphover+", '智力型', '推进 - 控制 - 爆发 - 辅助', '远程', '天辉', '小Y', '2015-05-30 19:08:51')";
    private static String Tinker = "INSERT INTO HEROS VALUES ('10302078', '修补匠', 'Tinker', "+R.drawable.tinker_hphover+", '智力型', '爆发 - 推进', '远程', '天辉', 'TK', '2015-05-30 19:08:51')";
    private static String NaturesProphet = "INSERT INTO HEROS VALUES ('10302079', '先知', 'Natures Prophet', "+R.drawable.furion_hphover+", '智力型', '打野 - 推进 - 核心 - 逃生', '远程', '天辉', 'FUR', '2015-05-30 19:08:51')";
    private static String Enchantress = "INSERT INTO HEROS VALUES ('10302080', '魅惑魔女', 'Enchantress', "+R.drawable.enchantress_hphover+", '智力型', '辅助 - 推进 - 耐久 - 打野', '远程', '天辉', '小鹿', '2015-05-30 19:08:51')";
    private static String Jakiro = "INSERT INTO HEROS VALUES ('10302081', '杰奇洛', 'Jakiro', "+R.drawable.jakiro_hphover+", '智力型', '爆发 - 推进 - 对线辅助 - 控制', '远程', '天辉', '双头龙', '2015-05-30 19:08:51')";
    private static String Chen = "INSERT INTO HEROS VALUES ('10302082', '陈', 'Chen', "+R.drawable.chen_hphover+", '智力型', '辅助 - 打野 - 推进', '远程', '天辉', 'Chen', '2015-05-30 19:08:51')";
    private static String Silencer = "INSERT INTO HEROS VALUES ('10302083', '沉默术士', 'Silencer', "+R.drawable.silencer_hphover+", '智力型', '辅助 - 核心 - 先手', '远程', '天辉', '沉默、诺崇', '2015-05-30 19:08:51')";
    private static String OgreMagi = "INSERT INTO HEROS VALUES ('10301084', '食人魔魔法师', 'Ogre Magi', "+R.drawable.ogre_magi_hphover+", '智力型', '爆发 - 控制 - 耐久', '近战', '天辉', '蓝胖子', '2015-05-30 19:08:51')";
    private static String Rubick = "INSERT INTO HEROS VALUES ('10302085', '拉比克', 'Rubick', "+R.drawable.rubick_hphover+", '智力型', '控制 - 爆发', '远程', '天辉', 'GM', '2015-05-30 19:08:51')";
    private static String Disruptor = "INSERT INTO HEROS VALUES ('10302086', '干扰者', 'Disruptor', "+R.drawable.disruptor_hphover+", '智力型', '爆发 - 辅助 - 先手 - 控制', '远程', '天辉', '萨尔', '2015-05-30 19:08:51')";
    private static String KeeperoftheLight = "INSERT INTO HEROS VALUES ('10302087', '光之守卫', 'Keeper of the Light', "+R.drawable.keeper_of_the_light_hphover+", '智力型', '爆发 - 辅助 - 对线辅助', '远程', '天辉', '光法、伊扎洛', '2015-05-30 19:08:51')";
    private static String SkywrathMage = "INSERT INTO HEROS VALUES ('10302088', '天怒法师', 'Skywrath Mage', "+R.drawable.skywrath_mage_hphover+", '智力型', '远程 - 爆发 - 辅助', '远程', '天辉', '龙鹰', '2015-05-30 19:08:51')";
    private static String Oracle = "INSERT INTO HEROS VALUES ('10302089', '神谕者', 'Oracle', "+R.drawable.oracle_hphover+", '智力型', '辅助 - 对线辅助 - 爆发', '远程', '天辉', '神谕者、Oracle', '2015-05-30 19:08:51')";
    private static String Techies = "INSERT INTO HEROS VALUES ('10302090', '工程师', 'Techies', "+R.drawable.techies_hphover+", '智力型', '爆发 - 辅助 - 控制', '远程', '天辉', '炸弹人、拉登', '2015-05-30 19:08:51')";
    private static String Bane = "INSERT INTO HEROS VALUES ('20302091', '祸乱之源', 'Bane', "+R.drawable.bane_hphover+", '智力型', '远程-控制-爆发-辅助', '远程', '夜魇', '痛苦之源', null);";
    private static String Lich = "INSERT INTO HEROS VALUES ('20302092', '巫妖', 'Lich', "+R.drawable.lich_hphover+", '智力型', '辅助 - 对线辅助 - 爆发', '远程', '夜魇', 'LICH', '2015-05-30 19:08:51')";
    private static String Lion = "INSERT INTO HEROS VALUES ('20302093', '莱恩', 'Lion', "+R.drawable.lion_hphover+", '智力型', '控制 - 爆发 - 对线辅助 - 辅助', '远程', '夜魇', 'Lion', '2015-05-30 19:08:51')";
    private static String WitchDoctor = "INSERT INTO HEROS VALUES ('20302094', '巫医', 'Witch Doctor', "+R.drawable.witch_doctor_hphover+", '智力型', '辅助 - 控制', '远程', '夜魇', 'WD', '2015-05-30 19:08:51')";
    private static String Enigma = "INSERT INTO HEROS VALUES ('20302095', '谜团', 'Enigma', "+R.drawable.enigma_hphover+", '智力型', '控制 - 先手 - 打野 - 推进', '远程', '夜魇', 'Enig', '2015-05-30 19:08:51')";
    private static String Necrophos = "INSERT INTO HEROS VALUES ('20302096', '瘟疫法师', 'Necrophos', "+R.drawable.necrolyte_hphover+", '智力型', '辅助 - 耐久 - 核心', '远程', '夜魇', 'NEC，死灵法', '')";
    private static String Warlock = "INSERT INTO HEROS VALUES ('20302097', '术士', 'Warlock', "+R.drawable.warlock_hphover+", '智力型', '先手 - 辅助 - 对线辅助 - 控制', '远程', '夜魇', 'Warlock', '2015-05-30 19:08:51')";
    private static String QueenofPain = "INSERT INTO HEROS VALUES ('20302098', '痛苦女王', 'Queen of Pain', "+R.drawable.queenofpain_hphover+", '智力型', '远程 - 爆发 - 逃生 - 核心', '远程', '夜魇', 'QOP', '2015-05-30 19:08:51')";
    private static String DeathProphet = "INSERT INTO HEROS VALUES ('20302099', '死亡先知', 'Death Prophet', "+R.drawable.death_prophet_hphover+", '智力型', '推进 - 爆发 - 耐久', '远程', '夜魇', 'DP', '2015-05-30 19:08:51')";
    private static String Pugna = "INSERT INTO HEROS VALUES ('20302100', '帕格纳', 'Pugna', "+R.drawable.pugna_hphover+", '智力型', '爆发 - 推进 - 辅助', '远程', '夜魇', '骨法', '2015-05-30 19:08:51')";
    private static String Dazzle = "INSERT INTO HEROS VALUES ('20302101', '戴泽', 'Dazzle', "+R.drawable.dazzle_hphover+", '智力型', '辅助 - 对线辅助', '远程', '夜魇', '暗牧', '2015-05-30 19:08:51')";
    private static String Leshrac = "INSERT INTO HEROS VALUES ('20302102', '拉席克', 'Leshrac', "+R.drawable.leshrac_hphover+", '智力型', '爆发 - 推进 - 控制 - 辅助', '远程', '夜魇', '老鹿，光鹿', '2015-05-30 19:08:51')";
    private static String DarkSeer = "INSERT INTO HEROS VALUES ('20301103', '黑暗贤者', 'Dark Seer', "+R.drawable.dark_seer_hphover+", '智力型', '先手 - 爆发 - 逃生', '近战', '夜魇', '兔子、黑贤、DS', '2015-05-30 19:08:51')";
    private static String Batrider = "INSERT INTO HEROS VALUES ('20302104', '蝙蝠骑士', 'Batrider', "+R.drawable.batrider_hphover+", '智力型', '先手 - 控制 - 爆发 - 逃生', '远程', '夜魇', '蝙蝠', '2015-05-30 19:08:51')";
    private static String AncientApparition = "INSERT INTO HEROS VALUES ('20302105', '远古冰魄', 'Ancient Apparition', "+R.drawable.ancient_apparition_hphover+", '智力型', '辅助 - 控制', '夜魇', '冰魂', '2015-05-30 19:08:51')";
    private static String Invoker = "INSERT INTO HEROS VALUES ('20302106', '祈求者', 'Invoker', "+R.drawable.invoker_hphover+", '智力型', '核心 - 爆发 - 先手 - 逃生', '远程', '夜魇', '卡尔、加若、Invoker', '2015-05-30 19:08:51')";
    private static String OutworldDevourer = "INSERT INTO HEROS VALUES ('20302107', '殁境神蚀者', 'Outworld Devourer', "+R.drawable.obsidian_destroyer_hphover+", '智力型', '核心', '远程', '夜魇', '黑鸟', '2015-05-30 19:08:51')";
    private static String ShadowDemon = "INSERT INTO HEROS VALUES ('20302108', '暗影恶魔', 'Shadow Demon', "+R.drawable.shadow_demon_hphover+", '智力型', '辅助 - 控制 - 爆发', '远程', '夜魇', '毒狗', '2015-05-30 19:08:51')";
    private static String Visage = "INSERT INTO HEROS VALUES ('20302109', '维萨吉', 'Visage', "+R.drawable.visage_hphover+", '智力型', '爆发 - 耐久 - 控制', '远程', '夜魇', '灰鸟，死灵飞龙', '2015-05-30 19:08:51')";
    private static String WinterWyvern = "INSERT INTO HEROS VALUES ('20302110', '寒冬飞龙', 'Winter Wyvern', "+R.drawable.winter_wyvern_hphover+", '智力型', '爆发 - 控制', '远程', '夜魇', '冰龙', '2015-05-30 19:08:51')";
    
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.aty_loading);
		initUI();
	}

	private void initUI() {
		sharedPreferences = this.getSharedPreferences("userInfo", MODE_PRIVATE);
		isFirstRun = sharedPreferences.getBoolean("isFirstRun", true);
		
		imgv_start = (ImageView) findViewById(R.id.imgv_start);
		bm = new BitmapManager();

		new Handler().postDelayed(new Runnable() {

			@Override
			public void run() {
				imgv_start.setImageResource(R.drawable.img_start); 
//				bm.loadBitmap(IMAGE_URL, imgv_start);
//				alphaAnimation = new AlphaAnimation(0.1f, 3.0f);
//				alphaAnimation.setDuration(1000);
//				imgv_start.startAnimation(alphaAnimation);
				
			}
		}, 1000);

		new Handler().postDelayed(new Runnable() {

			@Override
			public void run() {
				//第一次运行初始化数据
				if(isFirstRun){
					initData();
				}
				Intent in = new Intent(Loading.this, MainActivity.class);
				startActivity(in);
				finish();
				overridePendingTransition(android.R.anim.slide_in_left,
						android.R.anim.slide_out_right);
			}
		}, 2000);
	}
	
	/**
	 * 初始化数据
	 */
	private void initData(){
		ds = new DBHelperService(this);
		ds.executeSql(Earthshaker);
		ds.executeSql(Sven);
		ds.executeSql(Tiny);
		ds.executeSql(Kunkka);
		ds.executeSql(Beastmaster);
		ds.executeSql(DragonKnight);
		ds.executeSql(Clockwerk);
		ds.executeSql(Omniknight);
		ds.executeSql(Huskar);
		ds.executeSql(Alchemist);
		ds.executeSql(Brewmaster);
		ds.executeSql(Treant);
		ds.executeSql(IO);
		ds.executeSql(Centaur);
		ds.executeSql(Timbersaw);
		ds.executeSql(Bristleback);
		ds.executeSql(Tusk);
		ds.executeSql(ElderTitan);
		ds.executeSql(LegionCommander);
		ds.executeSql(EarthSpirit);
		ds.executeSql(Phoenix);
		ds.executeSql(Axe);
		ds.executeSql(Pudge);
		ds.executeSql(SandKing);
		ds.executeSql(Slardar);
		ds.executeSql(Tidehunter);
		ds.executeSql(WraithKing);
		ds.executeSql(Lifestealer);
		ds.executeSql(NightStalker);
		ds.executeSql(Doom);
		ds.executeSql(SpiritBreaker);
		ds.executeSql(Lycan);
		ds.executeSql(ChaosKnight);
		ds.executeSql(Undying);
		ds.executeSql(Magnus);
		ds.executeSql(Abaddon);
		ds.executeSql(AntiMage);
		ds.executeSql(DrowRanger);
		ds.executeSql(Juggernaut);
		ds.executeSql(Mirana);
		ds.executeSql(Morphling);
		ds.executeSql(PhantomLancer);
		ds.executeSql(VengefulSpirit);
		ds.executeSql(Riki);
		ds.executeSql(Sniper);
		ds.executeSql(TemplarAssassin);
		ds.executeSql(Luna);
		ds.executeSql(BountyHunter);
		ds.executeSql(Ursa);
		ds.executeSql(Gyrocopter);
		ds.executeSql(LoneDruid);
		ds.executeSql(NagaSiren);
		ds.executeSql(TrollWarlord);
		ds.executeSql(EmberSpirit);
		ds.executeSql(Bloodseeker);
		ds.executeSql(ShadowFiend);
		ds.executeSql(Razor);
		ds.executeSql(Venomancer);
		ds.executeSql(FacelessVoid);
		ds.executeSql(PhantomAssassin);
		ds.executeSql(Viper);
		ds.executeSql(clinkz);
		ds.executeSql(Broodmother);
		ds.executeSql(Weaver);
		ds.executeSql(Spectre);
		ds.executeSql(Meepo);
		ds.executeSql(NyxAssassin);
		ds.executeSql(Slark);
		ds.executeSql(Medusa);
		ds.executeSql(Terrorblade);
		ds.executeSql(CrystalMaiden);
		ds.executeSql(Puck);
		ds.executeSql(StormSpirit);
		ds.executeSql(Windranger);
		ds.executeSql(Zeus);
		ds.executeSql(Lina);
		ds.executeSql(ShadowShaman);
		ds.executeSql(Tinker);
		ds.executeSql(NaturesProphet);
		ds.executeSql(Enchantress);
		ds.executeSql(Jakiro);
		ds.executeSql(Chen);
		ds.executeSql(Silencer);
		ds.executeSql(OgreMagi);
		ds.executeSql(Rubick);
		ds.executeSql(Disruptor);
		ds.executeSql(KeeperoftheLight);
		ds.executeSql(SkywrathMage);
		ds.executeSql(Oracle);
		ds.executeSql(Techies);
		ds.executeSql(Bane);
		ds.executeSql(Lich);
		ds.executeSql(Lion);
		ds.executeSql(WitchDoctor);
		ds.executeSql(Enigma);
		ds.executeSql(Necrophos);//TODO
		ds.executeSql(Warlock);
		ds.executeSql(QueenofPain);
		ds.executeSql(DeathProphet);
		ds.executeSql(Pugna);
		ds.executeSql(Dazzle);
		ds.executeSql(Leshrac);
		ds.executeSql(DarkSeer);
		ds.executeSql(Batrider);
		ds.executeSql(AncientApparition);
		ds.executeSql(Invoker);
		ds.executeSql(OutworldDevourer);
		ds.executeSql(ShadowDemon);
		ds.executeSql(Visage);
		ds.executeSql(WinterWyvern);
		ds.closeDB();
		Editor edit = sharedPreferences.edit();
		edit.putBoolean("isFirstRun", false);
		edit.commit();
	}

}
